home *** CD-ROM | disk | FTP | other *** search
- public class ParticleMover extends Codex {
- private CodexThing _mover;
- private CodexThing _particleThing;
- private float _speed = 1200.0F;
- private float[] offset = new float[3];
- public static String[] _params = new String[]{"Particle Emitter", "Speed:1200.0"};
-
- public ParticleMover(CodexThing particleThing, float speed) {
- this._particleThing = new CodexThing(((Codex)particleThing).GetGUID());
- this._speed = speed;
- }
-
- public void beginscene(int clientGuid, int captureID) {
- this._mover = new CodexThing(((Codex)this).GetClassThing());
- this.offset[0] = 0.0F;
- this.offset[1] = 0.0F;
- this.offset[2] = 0.0F;
- this._mover.AttachThing(this._particleThing.GetGUID(), -1, this.offset, 1);
- this._mover.MoveToFrame(1, this._speed);
- }
-
- public void arrived(int thingGuid, int frameNum, int captureID) {
- if (frameNum + 1 < this._mover.GetNumFrames()) {
- this._mover.MoveToFrame(frameNum + 1, this._speed);
- } else {
- this._mover.MoveToFrame(0, this._speed);
- }
-
- }
- }
-